from rest_framework.routers import DefaultRouter
from django.urls import path, include
from rest_framework_simplejwt.views import TokenObtainPairView,TokenRefreshView
from .views import CustomTokenObtainPairView,LoginView,DeptView,ChangePasswordView
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register('dept', DeptView)

urlpatterns = [
    # 其他路由
    path('token/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),  # 获取 Token
    path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),  # 刷新 Token
    path('login/', LoginView.as_view(), name='login'),
    path('change-password/', ChangePasswordView.as_view(), name='change-password'),
]+router.urls